package com.muh.repository;

import com.muh.entity.Employee;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.elasticsearch.annotations.Query;
import org.springframework.data.elasticsearch.repository.ElasticsearchRepository;

import java.util.List;
import java.util.Map;

public interface EmployeeRepository extends ElasticsearchRepository<Employee, Long> {
//    @Query("{\"match\": {\"address\": \"?0\"}}")
//    List<Employee> findbyAddress(String address);

    List<Employee> findEmployeesByAddress(String address);

    Page<Employee> findEmployeesByAddress(String address, Pageable pageable);

    Page<Employee> findEmployeeByDescription(String description, Pageable pageable);

    Page<Employee> findEmployeeByRemark(String remark, Pageable pageable);

    Page<Employee> findEmployeesByName(String name, Pageable pageable);

    List<Employee> findEmployeesByName(String name);

    long countByAddress(String address);

}